using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace CroCommando
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class MenuHandler : Microsoft.Xna.Framework.DrawableGameComponent
    {
        
        private Game1.MenuState currentMenuState;
        enum MenuElement {PlayGame, Options, HighScores, Exit};


        public MenuHandler(Game game) : base(game)
        {
            // TODO: Construct any child components here
        }

        public Game1.MenuState CurrentMenuState
        {
            get;
            set;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here

            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            KeyboardState keyboardState = Keyboard.GetState();

            switch (currentMenuState) { 
                case Game1.MenuState.Intro:
                    if (keyboardState.IsKeyDown(Keys.Escape)) this.Game.Exit();
                    break;

                case Game1.MenuState.InGame:
                    if (keyboardState.IsKeyDown(Keys.Escape)) CurrentMenuState = Game1.MenuState.Intro;
                    break;

                case Game1.MenuState.GameOver:
                    if (keyboardState.IsKeyDown(Keys.Escape)) CurrentMenuState = Game1.MenuState.Intro;
                    break;
            }

            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            switch (currentMenuState)
            {
                case Game1.MenuState.Intro:
                    break;

                case Game1.MenuState.InGame:
                    break;

                case Game1.MenuState.GameOver:
                    break;
            }
            base.Draw(gameTime);
        }

        
        
    }
}
